import type { InternalAxiosRequestConfig, AxiosResponse, AxiosRequestConfig } from "axios";
//在new axios传入的拦截器
interface MyAXiosRequestConfig<T = AxiosResponse> extends AxiosRequestConfig {
  interceptor?: {
    //请求拦截器 拦截成功 拦截失败
    reqSuccessFn?: (config: InternalAxiosRequestConfig) => InternalAxiosRequestConfig;
    reqFailFn?: (err: any) => any;

    //响应拦截器 拦截成功 拦截失败
    resSuccessFn?: (res: T) => any;
    resFailFn?: (err: any) => any;

    //
  };

  parseRessult?: parseType;

  needLoading?: boolean;
}

enum parseType {
  NOPARSE = 0,
  DATA = 1,
  Left,
  Right,
}

export type { MyAXiosRequestConfig };

export { parseType };
